import Vue from 'vue';
import VueRouter from 'vue-router';
import home from '@/components/home/home.vue';
import detail from '@/components/detail/detail.vue';
import list from '@/components/detail/list.vue';
import nowplaying from '@/components/detail/nowplaying.vue';
import willplaying from '@/components/detail/willplaying.vue';
import cinema from '@/components/cinemas/cinema.vue';
import login from '@/components/usercenter/login.vue';
Vue.use(VueRouter);
export default new VueRouter({
	routes:[
		{
			path:'/home',
			name:'home',
			component: home
		},
		{
			path:'/film/:id',
			name:'detail',
			component:detail
		},
		{
			path:'/list',
			redirect:'/list/now-playing',
			name:'list',
			component:list,
			children:[
				{
					path:'now-playing',
					name:'nowplaying',
					component:nowplaying
				},
				{
					path:'will-playing',
					name:'willplaying',
					component:willplaying
				}
			]
		},
		{
			path:'/cinema',
			name:'cinema',
			component:cinema
		},
		{
			path:'/users/login',
			name:'login',
			component:login
		},
		{
			path:'*',
			redirect:'/home'
		}
	]
})

